<?php 
class Design {
	
	private $raiz, $path_lingua, $lingua;
	
	private $logo = array(
						1 => "jpribeirobranco.png",
						2 => "jpribeiropreto.png",
						3 => "jpribeirobranco.png",
						4 => "jpribeiroazul.png",
						5 => "jpribeirobranco.png", 
						6 => "jpribeiroamarelo.png",
						7 => "jpribeirobranco.png",
						8 => "jpribeirobranco.png");
	
	private $links = array(
						array(
							"arquivo" => "resume.php",
							"label" => array(
										"us" => "Resume",
										"br" => "Currículo")),
						array(
							"arquivo" => "experience.php",
							"label" => array(
										"us" => "Experience",
										"br" => "Experiência")),
						array(
							"arquivo" => "blog.php",
							"label" => array(
										"us" => "Blog",
										"br" => "Blog")),
						array(
							"arquivo" => "talks.php",
							"label" => array(
										"us" => "Talks",
										"br" => "Palestras")),
						array(
							"arquivo" => "contact.php",
							"label" => array(
										"us" => "Contact",
										"br" => "Contato")));
	
	function Design($lingua = "us") {
		$this->lingua = $lingua;
		if ($lingua != "us") {
			$this->path_lingua = "$lingua/";
			$this->raiz = "..";
		}
		else {
			$this->path_lingua = "";
			$this->raiz = ".";
		}
		date_default_timezone_set("America/Recife");
	}
	
	function imprimir_topo() {
		$numero_designs = count($this->logo);
		$numero = (integer) ((date("i") / (60 / ($numero_designs * 2))) % $numero_designs) + 1;
		echo "
		<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
		<html>
		<head>
		<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
		<link rel=\"stylesheet\" href=\"".$this->raiz."/css/estilo".sprintf("%02d", $numero).".css\" type=\"text/css\">
		<link rel=\"icon\" href=\"".$this->raiz."/img/favicon.ico\" type=\"image/x-icon\">
		<title>João Paulo Ribeiro</title>
		<script type=\"text/javascript\">

		  var _gaq = _gaq || [];
  		  _gaq.push(['_setAccount', 'UA-31024939-1']);
		  _gaq.push(['_trackPageview']);
		
		  (function() {
		    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  		  })();

		</script>
		</head>
		<body>
		<div class=\"meio\">
			<div class=\"barraFixa\">
				<div class=\"barraContatos\">
					<table border=\"0\" width=\"100%\">
						<tr valign=\"middle\">
							<td class=\"bandeiras\">
								<a href=\"".$this->raiz."/\"><img src=\"".$this->raiz."/img/us.gif\"></a>
								<a href=\"".$this->raiz."/br/\"><img src=\"".$this->raiz."/img/br.gif\"></a>
							</td>
							<td align=\"right\" width=\"99%\">
								<a href=\"http://jpribeiro.com\">jpribeiro.com</a>
								<a href=\"http://twitter.com/joaopribs\" target=\"_blank\">@joaopribs</a>
								<a href=\"mailto:joao@jpribeiro.com\" target=\"_blank\">joao@jpribeiro.com</a>
								+55 (83) 8824 5687
							</td>
						</tr>
					</table>
				</div>
				<div class=\"barraMenu\">
		";
		foreach ($this->links as $link) {
			echo "
					<a href=\"".$this->raiz."/".$this->path_lingua.$link["arquivo"]."\">".$link["label"][$this->lingua]."</a>
			";
		}
		echo "	
				</div>
			</div>
			<div class=\"logo\">
				<a href=\"".$this->raiz."/".$this->path_lingua."\"><img src=\"".$this->raiz."/img/".$this->logo[$numero]."\" alt=\"JPRibeiro.com\" style=\"padding-top: 30px; margin-bottom: 30px;\"/></a><br/>
				<table border=\"0\" width=\"100%\">
					<tr valign=\"middle\">
						<td align=\"center\">
							<a href=\"http://br.linkedin.com/in/joaopribeiro\" target=\"_blank\" class=\"comOverlay\">
								<img src=\"".$this->raiz."/img/linkedin_32.png\" />
								<span class=\"overlay\">
									<img src=\"".$this->raiz."/img/overlay_icones.png\" />
								</span>
							</a>
						</td>
						<td align=\"center\">
							<a href=\"http://twitter.com/joaopribs\" target=\"_blank\" class=\"comOverlay\">
								<img src=\"".$this->raiz."/img/twitter_32.png\" />
								<span class=\"overlay\">
									<img src=\"".$this->raiz."/img/overlay_icones.png\" />
								</span>
							</a>
						</td>
						<td align=\"center\">
							<a href=\"http://www.facebook.com/joaopaulo.ribs\" target=\"_blank\" class=\"comOverlay\">
								<img src=\"".$this->raiz."/img/facebook_32.png\" />
								<span class=\"overlay\">
									<img src=\"".$this->raiz."/img/overlay_icones.png\" />
								</span>
							</a>
						</td>
						<td align=\"center\">
							<a href=\"https://plus.google.com/103361381090178128835\" target=\"_blank\" class=\"comOverlay\">
								<img src=\"".$this->raiz."/img/google_plus_32.png\" />
								<span class=\"overlay\">
									<img src=\"".$this->raiz."/img/overlay_icones.png\" />
								</span>
							</a>
						</td>
						<td align=\"center\">
							<a href=\"http://www.lastfm.com.br/user/joaopribs\" target=\"_blank\" class=\"comOverlay\">
								<img src=\"".$this->raiz."/img/lastfm_32.png\" />
								<span class=\"overlay\">
									<img src=\"".$this->raiz."/img/overlay_icones.png\" />
								</span>
							</a>
						</td>
						<td align=\"center\">
							<a href=\"http://joaopribs.wordpress.com\" target=\"_blank\" class=\"comOverlay\">
								<img src=\"".$this->raiz."/img/wordpress_32.png\" />
								<span class=\"overlay\">
									<img src=\"".$this->raiz."/img/overlay_icones.png\" />
								</span>
							</a>
						</td>
					</tr>
				</table>
			</div>
			
			<div class=\"conteudo\">
		";
	}
	
	function imprimir_rodape() {
		echo "
			</div>
		</div>
		</body>
		</html>
		";
	}
	
}

?>